const isArray = function (val) {
  return Object.prototype.toString.call(val) === "[object Array]";
};

const isObject = function (val) {
  return Object.prototype.toString.call(val) === "[object Object]";
};

const isNull = function (val) {
  return (
    val === null || val === undefined || toString(val) === "[object Undefined]"
  );
};

const isNullObject = function (val) {
  return Object.keys(val).length === 0;
};

module.exports = {
  isArray,
  isObject,
  isNull,
  isNullObject,
};
